package icu.ikuns.pojo;

/**
 * @Author： Kimariyb
 * @Date：2022/05/22/15:03
 * @Description：
 */
public class Triangle {
    private double edgeA;
    private double edgeB;
    private double edgeC;

    public double getArea() {
        double p = (edgeA + edgeB + edgeC) / 2;
        return Math.sqrt(p * (p - edgeA) * (p - edgeB) * (p - edgeC));
    }

    public boolean isTriangle() {
        if (edgeA + edgeB > edgeC && edgeA + edgeC > edgeB && edgeB + edgeC > edgeA) {
            return true;
        } else {
            return false;
        }
    }

    public double getEdgeA() {
        return edgeA;
    }

    public void setEdgeA(double edgeA) {
        this.edgeA = edgeA;
    }

    public double getEdgeB() {
        return edgeB;
    }

    public void setEdgeB(double edgeB) {
        this.edgeB = edgeB;
    }

    public double getEdgeC() {
        return edgeC;
    }

    public void setEdgeC(double edgeC) {
        this.edgeC = edgeC;
    }

    public Triangle() {
    }

    public Triangle(double edgeA, double edgeB, double edgeC) {
        this.edgeA = edgeA;
        this.edgeB = edgeB;
        this.edgeC = edgeC;
    }
}
